#include<stdio.h>
//#include<math.h>

FILE *inf,*outf;
long   caseN;
long   pointN;		
double centreG,centreX,centreY,triaglG,triaglX,triaglY,x1,y1,x2,y2,x3,y3;

int main(){	

//	inf=fopen("stone.in","r");
	inf=stdin;
	outf=stdout;
//	outf=fopen("2015.out","w");
	
	fscanf(inf,"%d",&caseN);
	for (int caseI=0; caseI<caseN; caseI++){
		fscanf(inf,"%ld",&pointN);
		centreG=0;centreY=0;centreX=0;
		fscanf(inf,"%lf%lf",&x1,&y1);
		fscanf(inf,"%lf%lf",&x2,&y2);		
		for (int pointI=2; pointI<pointN; pointI++){			
			fscanf(inf,"%lf%lf",&x3,&y3);
			triaglX=(x1+x2+x3)/3;
			triaglY=(y1+y2+y3)/3;
			triaglG=(x1*y2+x2*y3+x3*y1-y1*x2-y2*x3-y3*x1)/2;
			if (centreG+triaglG == 0)  // 重心为坐标原点时
				triaglG+=1e-8;		
			centreX=(centreG*centreX+triaglG*triaglX)/(centreG+triaglG);
			centreY=(centreG*centreY+triaglG*triaglY)/(centreG+triaglG);
			centreG+=triaglG;
			x2=x3;y2=y3;
		}		
		fprintf(outf,"%.2f %.2f\n",centreX+1e-8,centreY+1e-8);		// 小心负零
	}
	fclose(inf);
	fclose(outf);
}